﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminIndexMaster.master" AutoEventWireup="true" CodeFile="Admin_Announce.aspx.cs" Inherits="Admin_Admin_Announce" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table class="adminheading">
   <tr>
      <th valign="middle" class="menus" align="left" width="70%"> 公告管理</th>
      <td align="right">
      <div style="width:500px"><a href="Admin_Announce.aspx?action=updateJs">生成公告JS</a>&nbsp;|&nbsp;<a href="javascript:void(0)" onclick="document.getElementById('AnnouncePanel').style.display='block';">公告JS调用代码</a>&nbsp;|&nbsp;<a href="Admin_AddAnnounce.aspx">发布公告</a></div></td>  
      <td class="rtdw"></td>
   </tr>                     
</table>

<asp:GridView id="GridView1" runat="server" CssClass="adminlist" OnDataBound="GridView1_DataBound" OnRowDataBound="GridView1_RowDataBound" DataSourceID="ObjectDataSource1" RowStyle-HorizontalAlign="Center" DataKeyNames="AnnounceID" AutoGenerateColumns="False" AllowPaging="True" PageSize="10">
  <Columns>
    <asp:BoundField ReadOnly="True" DataField="AnnounceID" InsertVisible="False" SortExpression="AnnounceID" HeaderText="ID"></asp:BoundField>
    <asp:BoundField DataField="AnnounceTitle" SortExpression="AnnounceTitle" HeaderText="公告标题"></asp:BoundField>
    <asp:BoundField DataField="AnnounceType" SortExpression="AnnounceType" HeaderText="公告类型"></asp:BoundField>
    <asp:BoundField DataField="AnnounceImportant" SortExpression="AnnounceImportant" HeaderText="公告等级"></asp:BoundField>
    <asp:BoundField DataField="AnnounceOwner" SortExpression="AnnounceOwner" HeaderText="发布人"></asp:BoundField>
    <asp:BoundField HtmlEncode="False" DataFormatString="{0:d}" DataField="AnnounceBegin" SortExpression="AnnounceBegin" HeaderText="公告发布日期"></asp:BoundField>
    <asp:BoundField HtmlEncode="False" DataFormatString="{0:d}" DataField="AnnounceEnd" SortExpression="AnnounceEnd" HeaderText="公告结束日期"></asp:BoundField>
    <asp:TemplateField HeaderText="内容">
        <EditItemTemplate>
            <asp:TextBox runat="server" Text='<%# Bind("AnnounceContent") %>' id="TextBox1"></asp:TextBox>
        </EditItemTemplate>
        <ItemTemplate>
            <asp:Label runat="server" Text='<%# Bind("AnnounceContent") %>' id="Label1"></asp:Label>
        </ItemTemplate>
    </asp:TemplateField>
    <asp:BoundField DataField="AnnounceReadCount" HeaderText="浏览量"></asp:BoundField>
    <asp:HyperLinkField HeaderText="修改" Text="修改" DataNavigateUrlFormatString="Admin_AddAnnounce.aspx?AnnounceID={0}" DataNavigateUrlFields="AnnounceID"></asp:HyperLinkField>
    <asp:TemplateField HeaderText="删除">
        <ItemTemplate>
            <asp:LinkButton ID="cl" runat="server" CommandName="Delete" OnClientClick="{if(confirm('确定删除吗？')) return true;return false;}" Text="删除"/>
        </ItemTemplate>
    </asp:TemplateField>
  </Columns>
    <EmptyDataTemplate>
        <tr>
          <th scope="col">公告编号</th><th scope="col">公告标题</th><th scope="col">公告类型</th><th scope="col">公告等级</th><th scope="col">发布人</th><th scope="col">公告发布日期</th><th scope="col">公告结束日期</th><th scope="col">内容</th><th scope="col">浏览量</th><th scope="col">修改</th><th scope="col">删除</th>
        </tr>
        <tr>
          <td colspan="11">暂无公告！</td>
        </tr>
    </EmptyDataTemplate>
    <RowStyle HorizontalAlign="Center"></RowStyle>
</asp:GridView>

	<div class="help_intro" >
	<h1 onclick="AnnouncePanel.style.display='block'" style="cursor:pointer">调用JS代码：</h1>
        <div id="AnnouncePanel" style="display:none;">
          <asp:Literal ID="announce_js_code" runat="server" />
	</div>
	</div>

          <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="DeleteAnnounce" SelectMethod="GetAnnounces" TypeName="HKB.Web.AnnounceBll" OldValuesParameterFormatString="{0}">
              <DeleteParameters>
                  <asp:Parameter Name="AnnounceID" Type="Int32" />
              </DeleteParameters>
          </asp:ObjectDataSource>
 
</asp:Content>

